<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div id="app">
        <h1>标题</h1>
        <p id = "p1">1</p>
        <p class="p2">2</p>
    </div>
<script>
    var app = document.getElementById("app");
    let h1 = document.getElementsByTagName("h1");
    let p1 = document.getElementById("p1");
    let p2 = document.getElementsByClassName("p2");

    console.log(app.children);//获得父节点下所有子节点

    //更新dom节点
    let a = document.getElementById("app")
    a.innerText = '123456' //修改文本的值
    a.innerHTML = '<h1>haha</h1>'//可以解析HTML标签
    a.style.color = 'red'//改变字体颜色
    a.style.fontSize = '100px'// - 需要转成驼峰命名
</script>
</body>
</html>